<template>

    <el-space wrap class="width-100-percent">
      <transition-group appear
                        name="animate__animated animate__bounce"
                        enter-active-class="animate__zoomIn"
                        leave-active-class="animate__bounceOut">
        <SchemeShowCard
                        class="margin-row-5"
                        v-for="(scheme,index) in schemeList "
                        :key="index"
                        :scheme="scheme"
                        @collect="handleClickCollect"
        ></SchemeShowCard>
      </transition-group>
    </el-space>


</template>

<script lang="ts" setup>
import {ref,defineProps,defineEmits} from "vue"
import SchemeShowCard, {SchemeShowCardType} from "@/components/scheme/SchemeShowCard.vue";
import {collectScheme} from "@/api/scheme/CollectApi";
import {ElMessage, ElMessageBox} from "element-plus";

let props=defineProps<{
  schemeList:SchemeShowCardType[]
}>()
// let emit=defineEmits(['clickCard'])


function handleClickCollect(scheme:SchemeShowCardType){
  collectScheme(scheme.id).then(resp=>{
    if(resp.code === 200){
      ElMessage({
        type:"success",
        message:"收藏成功"
      })
    }
  })
}
</script>

<style scoped lang="less">

</style>